/obj/item/weapon/reagent_containers/medicalpatch
	name = "medical patch"
	desc = "A Medicine Containing Patch that can hold up to thirty units."
	icon = 'icons/obj/syringe.dmi'
	item_state = "paper"
	icon_state = "patch"
	amount_per_transfer_from_this = 30
	possible_transfer_amounts = null	//list(5, 10, 15)
	volume = 30
	flags = FPRINT | TABLEPASS | OPENCONTAINER

	examine()
		set src in view()
		..()
		if(!(usr in view(2)) && usr != loc)
			return
		if(reagents && reagents.reagent_list.len)
			usr << "It contains:"
			for(var/datum/reagent/R in reagents.reagent_list)
				usr << "[R.volume] units of [R.name]"

	attack_hand()
		..()

	attack_paw()
		return attack_hand()

	afterattack(obj/target, mob/user , flag)
		if(ismob(target) && target != user)
			target.visible_message("<span class='danger'>[user] is trying to apply [src.name] on [target]!</span>", \
											"<span class='userdanger'>[user] is trying to apply [src.name] on [target]!</span>")
			if(!do_mob(user, target)) return
			target.visible_message("<span class='danger'>[user] applied [src.name] on [target]!", \
									"<span class='userdanger'>[user] applied [src.name] on [target]!")
			//Attack log entries are produced here due to failure to produce elsewhere. Remove them here if you have doubles from normal syringes.
			var/list/rinject = list()
			for(var/datum/reagent/R in src.reagents.reagent_list)
				rinject += R.name
			var/contained = english_list(rinject)
			var/mob/M = target
			log_attack("<font color='red'>[user.name] ([user.ckey]) applied [M.name] ([M.ckey]) with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])</font>")
			M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been applied ([contained]) with [src.name] by [user.name] ([user.ckey])</font>")
			user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to apply [M.name] ([M.ckey]) with [contained]</font>")

			reagents.reaction(target, INGEST)
			del(src)
		if(ismob(target) && target == user)
			//Attack log entries are produced here due to failure to produce elsewhere. Remove them here if you have doubles from normal syringes.
			var/list/rinject = list()
			for(var/datum/reagent/R in src.reagents.reagent_list)
				rinject += R.name
			var/contained = english_list(rinject)
			var/mob/M = target
			log_attack("<font color='red'>[user.name] ([user.ckey]) applied [M.name] ([M.ckey]) with [src.name], which had [contained] (INTENT: [uppertext(user.a_intent)])</font>")
			M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Applied themselves ([contained]) with [src.name].</font>")

			reagents.reaction(target, INGEST)
		spawn(5)
			target.add_fingerprint(user)
			src.reagents.trans_to(target, amount_per_transfer_from_this)
			user << "<span class='notice'>You apply the medical patch.</span>"
			del(src)

///Subtypes!///

/obj/item/weapon/reagent_containers/medicalpatch/brute/New()
	..()
	name = "Bruise Patch"
	desc = "A prefilled Medicine Patch designed to help repair tissue damage at a rapid rate."
	reagents.add_reagent("morphine", 25)
	reagents.add_reagent("tricordrazine", 5)

/obj/item/weapon/reagent_containers/medicalpatch/burn/New()
	..()
	name = "Burn Patch"
	desc = "A prefilled Medicine Patch designed to help repair burned tissue at a rapid rate."
	reagents.add_reagent("kelotane", 20)
	reagents.add_reagent("dermaline", 10)

/obj/item/weapon/reagent_containers/medicalpatch/antitoxin/New()
	..()
	name = "Anti-Toxin Patch"
	desc = "A prefilled Medicine Patch designed to help fight off poision at a rapid rate."
	reagents.add_reagent("anti_toxin", 25)
	reagents.add_reagent("hyronalin", 5)

/obj/item/weapon/reagent_containers/medicalpatch/anticrit/New()
	..()
	name = "Stabilizing Patch"
	desc = "A prefilled Medicine Patch designed to help stabilize someone in critical condition."
	reagents.add_reagent("epinephrine", 29)
	reagents.add_reagent("dexalinp", 1)

/obj/item/weapon/reagent_containers/medicalpatch/antirad/New()
	..()
	name = "Radiation Treatment Patch"
	desc = "A prefilled Medicine Patch designed to help fight off radiation and it's glowyness."
	reagents.add_reagent("hyronalin", 25)
	reagents.add_reagent("anti_toxin", 5)

/obj/item/weapon/reagent_containers/medicalpatch/anticlone/New()
	..()
	name = "DNA Repair Patch"
	desc = "A prefilled Medicine Patch designed to help repair torn up DNA and bodies. It also minorly heals other wounds."
	reagents.add_reagent("cryoxadone", 15)
	reagents.add_reagent("clonexadone", 10)
	reagents.add_reagent("doctorsdelight", 5)